﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Altairis.Nemesis.Gallery.Configuration {

    public class TemplateParameterCollection : ConfigurationElementCollection {
        protected override ConfigurationElement CreateNewElement() {
            return new TemplateParameterElement();
        }

        protected override object GetElementKey(ConfigurationElement element) {
            return ((TemplateParameterElement)element).Name;
        }
    }

    public class TemplateParameterElement : ConfigurationElement {

        [ConfigurationProperty("name", IsRequired = true, IsKey = true)]
        public string Name {
            get { return (string)this["name"]; }
            set { this["name"] = value; }
        }

        [ConfigurationProperty("value", IsRequired = true)]
        public string Value {
            get { return (string)this["value"]; }
            set { this["value"] = value; }
        }

        [ConfigurationProperty("namespace", IsRequired = false, DefaultValue = "")]
        public string Namespace {
            get { return (string)this["namespace"]; }
            set { this["namespace"] = value; }
        }

    }

}
